using System.Collections;
using UnityEngine;

public class ButtonSave : MonoBehaviour
{
	private string str;

	private void OnGUI()
	{
		if (GUILayout.Button("Save 1 Key", GUILayout.MinWidth(200f), GUILayout.MinHeight(50f)))
		{
			str = "start";
			CryptoPlayerPrefs.SetInt("key1", 0);
			str = "finish";
		}
		if (GUILayout.Button("Save 100 Key", GUILayout.MinWidth(400f), GUILayout.MinHeight(50f)))
		{
			str = "start";
			for (int i = 0; i < 100; i++)
			{
				CryptoPlayerPrefs.SetInt("key0" + i, 0);
			}
			str = "finish";
		}
		if (GUILayout.Button("Save 270 Key", GUILayout.MinWidth(600f), GUILayout.MinHeight(50f)))
		{
			str = "start";
			for (int j = 0; j < 270; j++)
			{
				CryptoPlayerPrefs.SetInt("key00" + j, 0);
			}
			str = "finish";
		}
		if (GUILayout.Button("Save 500 Key", GUILayout.MinWidth(800f), GUILayout.MinHeight(50f)))
		{
			str = "start";
			StartCoroutine(start());
			str = "finish";
		}
		GUI.Label(new Rect(10f, Screen.height - 30, 300f, 20f), "text:" + str);
	}

	private IEnumerator start()
	{
		for (int i = 0; i < 500; i++)
		{
			CryptoPlayerPrefs.SetInt("key000" + i, 0);
			yield return null;
		}
	}
}
